﻿<Grid
    x:Class="Antares.VIEWs.ProjectTaskItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Antares.VIEWs"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Converters="using:Antares.Converters"
    
    Tapped="Grid_Tapped_1"
    mc:Ignorable="d"
    Height="90"
    Width="292">
    
    <Grid.Transitions>
        <TransitionCollection>
            <PopupThemeTransition/>
        </TransitionCollection>
    </Grid.Transitions>

    <Grid.Resources>
        <Style x:Key="TxtProjectStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="SemiLight"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="24"/>
        </Style>

        <Style x:Key="DateTimeStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontWeight" Value="SemiLight"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="16"/>
        </Style>

        <Converters:BoolToOpacityConverter x:Key="BoolToOpacityConverter"/>
        <Converters:TimeToColorConverter x:Key="TimeToColorConverter"/>
        <Converters:TaskToColorConverter x:Key="TaskToColorConverter"/>
        <Converters:TaskToIconConverter x:Key="TaskToIconConverter"/>
        <Converters:DataContextToDateRangeConverter x:Key="DataContextToDateRangeConverter"/>
    </Grid.Resources>
    <Grid.RowDefinitions>
        <RowDefinition Height="6"/>
        <RowDefinition Height="30"/>
        <RowDefinition Height="26"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="5"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="13"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="10"/>
    </Grid.ColumnDefinitions>
    <!--<Image Grid.ColumnSpan="3" Grid.RowSpan="5" Source="../Assets/TaskTemplate/BgTask2.png" Stretch="None"></Image>-->
    <Rectangle Margin="0,2.5,0,0"   Grid.ColumnSpan="3" Grid.RowSpan="5"  Fill="{Binding Converter={StaticResource TaskToColorConverter}}" Opacity="{Binding IsConfirmed, Converter={StaticResource BoolToOpacityConverter}}"></Rectangle>
    <Image Grid.ColumnSpan="1" Grid.RowSpan="3" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Source="../Assets/TaskTemplate/TaskTagGreen.png" Stretch="None"></Image>
    <Image Grid.ColumnSpan="1" Grid.RowSpan="3" VerticalAlignment="Top" Margin="0,0,0,3" Grid.Column="1" HorizontalAlignment="Right" Source="{Binding Converter={StaticResource TimeToColorConverter}}" Stretch="None"></Image>

    <Image  Margin="0,2.5,0,0" Grid.ColumnSpan="3"  Source="{Binding Converter={StaticResource TaskToIconConverter}}" Grid.RowSpan="5" HorizontalAlignment="Left"></Image>
    <!--<Rectangle  Fill="#bdbdbd" Height="1" Grid.Row="1" Grid.Column="1" VerticalAlignment="Bottom" Margin="0,2,0,0" />-->
    <TextBlock  HorizontalAlignment="Left" Grid.Row="1" Grid.Column="1" Style="{StaticResource TxtProjectStyle}" Text="{Binding Name}" VerticalAlignment="Bottom"  TextTrimming="WordEllipsis"/>
    <TextBlock  HorizontalAlignment="Left" Grid.Row="2" Grid.Column="1" VerticalAlignment="Top" Margin="0,0,0,5" Style="{StaticResource DateTimeStyle}" Text="{Binding Converter={StaticResource DataContextToDateRangeConverter}}" TextTrimming="WordEllipsis"/>
    <TextBlock Grid.Column="1" Grid.Row="3" VerticalAlignment="Bottom" FontSize="14"  Foreground="#b2b2b2" HorizontalAlignment="Right" Style="{StaticResource DateTimeStyle}" Text="{Binding Username}" TextTrimming="WordEllipsis"/>
</Grid>
